cmake_minimum_required(VERSION 3.9)
set(CMAKE_CXX_STANDARD 14)

include_directories("~/libboost/include")

link_directories("~/libboost/lib")

add_definitions("-Wall -DBOOST_LOG_DYN_LINK -static -Bstatic")

link_libraries(
        boost_regex
        boost_date_time
        boost_thread
        boost_system
        boost_log_setup
        boost_filesystem
        boost_log
        boost_serialization
        pthread
        opencv_calib3d
        opencv_contrib
        opencv_core
        opencv_features2d
        opencv_flann
        opencv_gpu
        opencv_highgui
        opencv_imgproc
        opencv_legacy
        opencv_ml
        opencv_nonfree
        opencv_objdetect
        opencv_ocl
        opencv_photo
        opencv_stitching
        opencv_superres
        opencv_ts
        opencv_video
        opencv_videostab
        GL
        GLU
        rt
        m
        dl
)

add_executable(nefd nefd/nefd.cpp include.h socket/server.cpp socket/server.h socket/session.cpp socket/session.h sharedmemory/shm.cpp sharedmemory/shm.h nefd/utils.h protocal/all_req_pack.h protocal/all_data_pack.h)
add_executable(socket socket/socket.cpp include.h socket/server.cpp socket/server.h socket/session.cpp socket/session.h sharedmemory/shm.cpp sharedmemory/shm.h socket/config.h socket/test_socket.h protocal/cam_req_pack.h protocal/cam_data_pack.h protocal/imu_req_pack.h protocal/imu_data_pack.h socket/shm_data.h)
add_executable(imumanager imu/imu.h protocal/imu/imu_time.h protocal/imu/imu_acceleration.h protocal/imu/imu_protocal.h protocal/imu/imu_angularVelocity.h protocal/imu/imu_angle.h protocal/imu/imu_magneticOutput.h protocal/imu/imu_portStatus.h protocal/imu/imu_pressureAndHeightOutput.h protocal/imu/imu_latitudeAndLongitudeOutput.h protocal/imu/imu_groundSpeed.h protocal/imu/imu_quaternion.h protocal/imu/imu_frame.h include.h sharedmemory/shm.cpp sharedmemory/shm.h protocal/imu/voice_command.h protocal/all_req_pack.h protocal/all_data_pack.h imu/Serial.cpp imu/Serial.h imu/rw_lock.cpp imu/rw_lock.h imu/global_var.h imu/main.cpp imu/shm_data.h imu/imu_data_parser.cpp imu/imu_data_parser.h imu/shm_pack.h)
add_executable(camservice camservice/cam.cpp protocal/cam/cam_singleMat.h protocal/cam/cam_original_Mat.h protocal/cam/cam_disparity.h protocal/cam/cam_cameraInfo.h protocal/cam/cam_frame.h include.h sharedmemory/shm.cpp sharedmemory/shm.h camservice/algorithm/calibration/CameraCalibrator.cpp camservice/algorithm/calibration/CameraCalibrator.h camservice/algorithm/calibration/calibrate.h camservice/algorithm/3d_rebuild/do_sgbm.h protocal/cam/cam_gesture.h camservice/algorithm/Common.cpp camservice/algorithm/Common.h camservice/GestureReconition/GestureReconition.cpp camservice/GestureReconition/GestureReconition.h camservice/GestureReconition/GestureReconition_do.h protocal/all_req_pack.h protocal/all_data_pack.h protocal/cam/cam_protocal.h protocal/gpio_req_pack.h protocal/gpio_data_pack.h camservice/base/global_var.h camservice/base/rw_lock.cpp camservice/base/rw_lock.h camservice/base/raw_data.h camservice/base/thread_get_raw.h protocal/imu/imu_request_parser.h camservice/algorithm/3d_rebuild/thread_sgbm.h)
add_executable(gpioservice gpioservice/gpio.cpp include.h sharedmemory/shm.cpp sharedmemory/shm.h protocal/gpio/gpio_request.h protocal/all_req_pack.h protocal/all_data_pack.h)
add_executable(testclient testclient/main.cpp socket/test_socket.h protocal/all_req_pack.h protocal/all_data_pack.h)